package com.zabra.zl.ui.search_list;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.zabra.zl.R;
import com.zabra.zl.base.BaseMvpActivity;
import com.zabra.zl.ui.search.Adp;
import com.zabra.zl.ui.search_list.contract.SearchListContract;
import com.zabra.zl.ui.search_list.presenter.SearchListPresenter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class SearchListActivity extends BaseMvpActivity<SearchListPresenter> implements SearchListContract.View {


    @BindView(R.id.back)
    LinearLayout back;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.recycler)
    RecyclerView recycler;
    private List<String> list = new ArrayList<>();
    private Adp adp;
    @Override
    public int getLayoutId() {
        return R.layout.activity_search_list;
    }

    @Override
    public void initView() {
        tvTitle.setText("搜索结果");
        list.add("中国电信");
        recycler.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
        recycler.setNestedScrollingEnabled(false);
        adp = new Adp(R.layout.item_hot, list);
        recycler.setAdapter(adp);
        adp.openLoadAnimation();
    }

    @Override
    public void showLoading() {

    }

    @Override
    public void hideLoading() {

    }

    @Override
    public void onError(Throwable throwable) {

    }


    @OnClick(R.id.back)
    public void onViewClicked() {
        finish();
    }
}
